<?php
include_once $_SERVER['DOCUMENT_ROOT'].'/phorm/model/fields/TextField.php';

class MD5Password extends TextField
{
	const DEFAULT_LENGTH = 32;
	
	public function __construct(IDatabaseRecord &$object, $defaultValue = null)
	{
		parent::__construct($object, MD5Password::DEFAULT_LENGTH, $defaultValue);
	}

	public function handleUserDefinedValue(&$value)
	{
		$value = hash('md5',$value);
	}
}
?>
